package edu.buffalo.cse.cse486_586.simpledht.config;

import edu.buffalo.cse.cse486_586.util.AppUtil;

public class Node {
	private int nodePort;
	private int redirPort;
	private int predecessor;
	private int successor;
	private String hashKey;

	public int getNodePort() {
		return nodePort;
	}

	public void setNodePort(int nodePort) {
		this.nodePort = nodePort;
	}

	public int getRedirPort() {
		return redirPort;
	}

	public void setRedirPort(int redirPort) {
		this.redirPort = redirPort;
	}

	public int getPredecessor() {
		return predecessor;
	}

	public void setPredecessor(int predecessor) {
		this.predecessor = predecessor;
	}

	public int getSuccessor() {
		return successor;
	}

	public void setSuccessor(int successor) {
		this.successor = successor;
	}

	public String getHashKey() {
		return hashKey;
	}

	public void setHashKey(String hashKey) {
		this.hashKey = hashKey;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(this.getNodePort()).append(AppUtil.DELIMITER)
				.append(this.predecessor).append(AppUtil.DELIMITER)
				.append(this.successor);

		return sb.toString();
	}
}
